﻿using System;
using System.Collections.Generic;
using System.Text;

namespace MatchCore
{
    public enum CommandType
    {
        Move = 1,
        Shoot = 2,
    }

    public enum MoveDirType
    {
        Up = 1,
        Down = 2,
    }

    public class Command
    {
        public static CommandType ParseCommandType(uint frameData)
        {
            return (CommandType)((frameData & 0xff000000) >> 24);
        }
        public static uint SetCommandType(uint frameData,CommandType type)
        {
            return (frameData & 0x00ffffff) | ((uint)type << 24);
        }

        public static MoveDirType ParseMoveDirType(uint frameData)
        {
            return (MoveDirType)(frameData & 0xff);
        }
        public static uint SetMoveDirType(uint frameData, MoveDirType type)
        {
            return (frameData & 0xffffff00) | ((uint)type);
        }
    }
}
